home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / receipt / grid1dlg.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-07-21  |  17.2 KB  |  557 lines

  1. VERSION 2.00
  2. Begin Form Form3 
  3.    Caption         =   "Item 1"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   750
  6.    ClientTop       =   1845
  7.    ClientWidth     =   8310
  8.    Height          =   5070
  9.    Left            =   690
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form3"
  12.    ScaleHeight     =   311
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   554
  15.    Top             =   1500
  16.    Width           =   8430
  17.    Begin CommandButton Command1 
  18.       Caption         =   "Done"
  19.       Height          =   375
  20.       Index           =   3
  21.       Left            =   6240
  22.       TabIndex        =   8
  23.       Top             =   3960
  24.       Width           =   1455
  25.    End
  26.    Begin CommandButton Command1 
  27.       Caption         =   "Clear"
  28.       Height          =   375
  29.       Index           =   2
  30.       Left            =   4440
  31.       TabIndex        =   7
  32.       Top             =   3960
  33.       Width           =   1455
  34.    End
  35.    Begin CommandButton Command1 
  36.       Caption         =   "Previous Item"
  37.       Height          =   375
  38.       Index           =   1
  39.       Left            =   2640
  40.       TabIndex        =   6
  41.       Top             =   3960
  42.       Width           =   1455
  43.    End
  44.    Begin CommandButton Command1 
  45.       Caption         =   "Next Item"
  46.       Height          =   375
  47.       Index           =   0
  48.       Left            =   720
  49.       TabIndex        =   5
  50.       Top             =   3960
  51.       Width           =   1575
  52.    End
  53.    Begin VBedit BEdit5 
  54.       CellHeight      =   32
  55.       CellWidth       =   22
  56.       CharSet         =   16420
  57.       CombBaseLine    =   24.333
  58.       CombEndHeight   =   8
  59.       CombEndMarker   =   0   'False
  60.       CombHeight      =   4
  61.       FontBold        =   0   'False
  62.       FontItalic      =   0   'False
  63.       FontName        =   "Arial"
  64.       FontSize        =   18
  65.       FontStrikethru  =   0   'False
  66.       FontUnderline   =   0   'False
  67.       Height          =   495
  68.       InflateBottom   =   12
  69.       InflateLeft     =   12
  70.       InflateRight    =   12
  71.       InflateTop      =   16
  72.       Left            =   5160
  73.       TabIndex        =   12
  74.       Text            =   "   0.00"
  75.       Top             =   3120
  76.       Version         =   268435458
  77.       Width           =   2415
  78.    End
  79.    Begin PictureBox Picture2 
  80.       AutoSize        =   -1  'True
  81.       Height          =   510
  82.       Index           =   11
  83.       Left            =   2085
  84.       Picture         =   GRID1DLG.FRX:0000
  85.       ScaleHeight     =   480
  86.       ScaleWidth      =   480
  87.       TabIndex        =   29
  88.       Top             =   2910
  89.       Visible         =   0   'False
  90.       Width           =   510
  91.    End
  92.    Begin PictureBox Picture2 
  93.       AutoSize        =   -1  'True
  94.       Height          =   510
  95.       Index           =   10
  96.       Left            =   1590
  97.       Picture         =   GRID1DLG.FRX:0302
  98.       ScaleHeight     =   480
  99.       ScaleWidth      =   480
  100.       TabIndex        =   28
  101.       Top             =   2910
  102.       Visible         =   0   'False
  103.       Width           =   510
  104.    End
  105.    Begin PictureBox Picture2 
  106.       AutoSize        =   -1  'True
  107.       Height          =   510
  108.       Index           =   9
  109.       Left            =   1095
  110.       Picture         =   GRID1DLG.FRX:0604
  111.       ScaleHeight     =   480
  112.       ScaleWidth      =   480
  113.       TabIndex        =   27
  114.       Top             =   2910
  115.       Visible         =   0   'False
  116.       Width           =   510
  117.    End
  118.    Begin PictureBox Picture2 
  119.       AutoSize        =   -1  'True
  120.       Height          =   510
  121.       Index           =   8
  122.       Left            =   600
  123.       Picture         =   GRID1DLG.FRX:0906
  124.       ScaleHeight     =   480
  125.       ScaleWidth      =   480
  126.       TabIndex        =   26
  127.       Top             =   2910
  128.       Visible         =   0   'False
  129.       Width           =   510
  130.    End
  131.    Begin PictureBox Picture2 
  132.       AutoSize        =   -1  'True
  133.       Height          =   510
  134.       Index           =   7
  135.       Left            =   105
  136.       Picture         =   GRID1DLG.FRX:0C08
  137.       ScaleHeight     =   480
  138.       ScaleWidth      =   480
  139.       TabIndex        =   25
  140.       Top             =   2910
  141.       Visible         =   0   'False
  142.       Width           =   510
  143.    End
  144.    Begin PictureBox Picture1 
  145.       AutoSize        =   -1  'True
  146.       Height          =   510
  147.       Left            =   7080
  148.       ScaleHeight     =   480
  149.       ScaleWidth      =   480
  150.       TabIndex        =   16
  151.       Top             =   1920
  152.       Width           =   510
  153.    End
  154.    Begin VBedit BEdit4 
  155.       CellHeight      =   32
  156.       CellWidth       =   22
  157.       CombBaseLine    =   24.333
  158.       CombEndHeight   =   8
  159.       CombEndMarker   =   0   'False
  160.       CombHeight      =   4
  161.       FontBold        =   0   'False
  162.       FontItalic      =   0   'False
  163.       FontName        =   "Arial"
  164.       FontSize        =   18
  165.       FontStrikethru  =   0   'False
  166.       FontUnderline   =   0   'False
  167.       Height          =   1095
  168.       InflateBottom   =   12
  169.       InflateLeft     =   12
  170.       InflateRight    =   12
  171.       InflateTop      =   16
  172.       Left            =   1440
  173.       TabIndex        =   9
  174.       Top             =   1680
  175.       Version         =   268435458
  176.       Width           =   5415
  177.    End
  178.    Begin VBedit BEdit3 
  179.       CellHeight      =   32
  180.       CellWidth       =   22
  181.       CharSet         =   16388
  182.       CombBaseLine    =   28
  183.       CombEndHeight   =   8
  184.       CombEndMarker   =   0   'False
  185.       CombHeight      =   4
  186.       FontBold        =   0   'False
  187.       FontItalic      =   0   'False
  188.       FontName        =   "Arial"
  189.       FontSize        =   18
  190.       FontStrikethru  =   0   'False
  191.       FontUnderline   =   0   'False
  192.       Height          =   495
  193.       InflateBottom   =   12
  194.       InflateLeft     =   12
  195.       InflateRight    =   12
  196.       InflateTop      =   16
  197.       Left            =   6255
  198.       TabIndex        =   15
  199.       Top             =   840
  200.       Version         =   268435458
  201.       Width           =   1335
  202.    End
  203.    Begin VBedit BEdit2 
  204.       CellHeight      =   32
  205.       CellWidth       =   22
  206.       CharSet         =   16651
  207.       CombBaseLine    =   24.333
  208.       CombEndHeight   =   8
  209.       CombEndMarker   =   0   'False
  210.       CombHeight      =   4
  211.       FontBold        =   0   'False
  212.       FontItalic      =   0   'False
  213.       FontName        =   "Arial"
  214.       FontSize        =   18
  215.       FontStrikethru  =   0   'False
  216.       FontUnderline   =   0   'False
  217.       Height          =   495
  218.       InflateBottom   =   12
  219.       InflateLeft     =   12
  220.       InflateRight    =   12
  221.       InflateTop      =   16
  222.       Left            =   3480
  223.       TabIndex        =   11
  224.       Top             =   840
  225.       Version         =   268435458
  226.       Width           =   1095
  227.    End
  228.    Begin VBedit BEdit1 
  229.       CellHeight      =   32
  230.       CellWidth       =   22
  231.       CharSet         =   16388
  232.       CombBaseLine    =   24.333
  233.       CombEndHeight   =   8
  234.       CombEndMarker   =   0   'False
  235.       CombHeight      =   4
  236.       FontBold        =   0   'False
  237.       FontItalic      =   0   'False
  238.       FontName        =   "Arial"
  239.       FontSize        =   18
  240.       FontStrikethru  =   0   'False
  241.       FontUnderline   =   0   'False
  242.       Height          =   495
  243.       InflateBottom   =   12
  244.       InflateLeft     =   12
  245.       InflateRight    =   12
  246.       InflateTop      =   16
  247.       Left            =   1200
  248.       TabIndex        =   10
  249.       Top             =   840
  250.       Version         =   268435458
  251.       Width           =   1095
  252.    End
  253.    Begin ComboBox Combo1 
  254.       Height          =   300
  255.       Left            =   960
  256.       TabIndex        =   13
  257.       Top             =   240
  258.       Width           =   3015
  259.    End
  260.    Begin PictureBox Picture2 
  261.       AutoSize        =   -1  'True
  262.       Height          =   510
  263.       Index           =   6
  264.       Left            =   7080
  265.       Picture         =   GRID1DLG.FRX:0F0A
  266.       ScaleHeight     =   480
  267.       ScaleWidth      =   480
  268.       TabIndex        =   21
  269.       Top             =   120
  270.       Visible         =   0   'False
  271.       Width           =   510
  272.    End
  273.    Begin PictureBox Picture2 
  274.       AutoSize        =   -1  'True
  275.       Height          =   510
  276.       Index           =   5
  277.       Left            =   6600
  278.       Picture         =   GRID1DLG.FRX:120C
  279.       ScaleHeight     =   480
  280.       ScaleWidth      =   480
  281.       TabIndex        =   20
  282.       Top             =   120
  283.       Visible         =   0   'False
  284.       Width           =   510
  285.    End
  286.    Begin PictureBox Picture2 
  287.       AutoSize        =   -1  'True
  288.       Height          =   510
  289.       Index           =   4
  290.       Left            =   6120
  291.       Picture         =   GRID1DLG.FRX:150E
  292.       ScaleHeight     =   480
  293.       ScaleWidth      =   480
  294.       TabIndex        =   22
  295.       Top             =   120
  296.       Visible         =   0   'False
  297.       Width           =   510
  298.    End
  299.    Begin PictureBox Picture2 
  300.       AutoSize        =   -1  'True
  301.       Height          =   510
  302.       Index           =   3
  303.       Left            =   5640
  304.       Picture         =   GRID1DLG.FRX:1810
  305.       ScaleHeight     =   480
  306.       ScaleWidth      =   480
  307.       TabIndex        =   17
  308.       Top             =   120
  309.       Visible         =   0   'False
  310.       Width           =   510
  311.    End
  312.    Begin PictureBox Picture2 
  313.       AutoSize        =   -1  'True
  314.       Height          =   510
  315.       Index           =   2
  316.       Left            =   5160
  317.       Picture         =   GRID1DLG.FRX:1B12
  318.       ScaleHeight     =   480
  319.       ScaleWidth      =   480
  320.       TabIndex        =   18
  321.       Top             =   120
  322.       Visible         =   0   'False
  323.       Width           =   510
  324.    End
  325.    Begin PictureBox Picture2 
  326.       AutoSize        =   -1  'True
  327.       Height          =   510
  328.       Index           =   1
  329.       Left            =   4680
  330.       Picture         =   GRID1DLG.FRX:1E14
  331.       ScaleHeight     =   480
  332.       ScaleWidth      =   480
  333.       TabIndex        =   19
  334.       Top             =   120
  335.       Visible         =   0   'False
  336.       Width           =   510
  337.    End
  338.    Begin PictureBox Picture2 
  339.       AutoSize        =   -1  'True
  340.       Height          =   510
  341.       Index           =   0
  342.       Left            =   4200
  343.       Picture         =   GRID1DLG.FRX:2116
  344.       ScaleHeight     =   480
  345.       ScaleWidth      =   480
  346.       TabIndex        =   23
  347.       Top             =   120
  348.       Visible         =   0   'False
  349.       Width           =   510
  350.    End
  351.    Begin Label Label7 
  352.       Caption         =   "Price Each:"
  353.       Height          =   255
  354.       Left            =   3690
  355.       TabIndex        =   4
  356.       Top             =   3240
  357.       Width           =   1095
  358.    End
  359.    Begin Label Label6 
  360.       Caption         =   "$"
  361.       FontBold        =   0   'False
  362.       FontItalic      =   0   'False
  363.       FontName        =   "Arial"
  364.       FontSize        =   18
  365.       FontStrikethru  =   0   'False
  366.       FontUnderline   =   0   'False
  367.       Height          =   375
  368.       Left            =   4920
  369.       TabIndex        =   24
  370.       Top             =   3150
  371.       Width           =   225
  372.    End
  373.    Begin Label Label5 
  374.       Caption         =   "Description:"
  375.       Height          =   255
  376.       Left            =   120
  377.       TabIndex        =   1
  378.       Top             =   1800
  379.       Width           =   1095
  380.    End
  381.    Begin Label Label3 
  382.       Caption         =   "Item No."
  383.       Height          =   255
  384.       Left            =   5040
  385.       TabIndex        =   14
  386.       Top             =   960
  387.       Width           =   735
  388.    End
  389.    Begin Label Label2 
  390.       Caption         =   "Unit:"
  391.       Height          =   255
  392.       Left            =   2880
  393.       TabIndex        =   3
  394.       Top             =   960
  395.       Width           =   375
  396.    End
  397.    Begin Label Label1 
  398.       Caption         =   "Quantity:"
  399.       Height          =   255
  400.       Left            =   240
  401.       TabIndex        =   2
  402.       Top             =   960
  403.       Width           =   735
  404.    End
  405.    Begin Label Label4 
  406.       Caption         =   "Item:"
  407.       Height          =   255
  408.       Left            =   240
  409.       TabIndex        =   0
  410.       Top             =   240
  411.       Width           =   495
  412.    End
  413. Dim CurItem As Integer
  414. Sub Combo1_Click ()
  415.    Picture1.Picture = Picture2(Combo1.ListIndex).Picture
  416.    BEdit2.Text = ItemInfo(Combo1.ListIndex).Unit
  417.    BEdit3.Text = LTrim$(Str$(Combo1.ListIndex))
  418.    BEdit4.Text = ItemInfo(Combo1.ListIndex).Info
  419.    BEdit5.Text = Format$(ItemInfo(Combo1.ListIndex).Price, "###0.00")
  420. End Sub
  421. Sub Command1_Click (Index As Integer)
  422.    Select Case Index
  423.       Case 0
  424.          Form2.Grid1.Row = CurItem      ' Save current entry
  425.          Form2.Grid1.Col = 0
  426.          Form2.Grid1.Text = BEdit1.Text
  427.          Form2.Grid1.Col = 1
  428.          Form2.Grid1.Text = BEdit2.Text
  429.          Form2.Grid1.Col = 2
  430.          Form2.Grid1.Text = BEdit3.Text
  431.          Form2.Grid1.Col = 3
  432.          Form2.Grid1.Text = BEdit4.Text
  433.          Form2.Grid1.Col = 4
  434.          Form2.Grid1.Text = BEdit5.Text
  435.          CompressItems
  436.          If CurItem < MAXITEMS Then   ' At bottom of list
  437.             CurItem = CurItem + 1     ' create new entry
  438.             NumItems = NumItems + 1
  439.             Form3.Caption = "Item" + Str$(CurItem)
  440.          Else
  441.             MsgBox "No Available Entry Space"
  442.          End If
  443.          Form2.Grid1.Row = CurItem       'Highlight current entry
  444.          Form2.Grid1.SelStartCol = 0
  445.          Form2.Grid1.SelEndCol = 5
  446.          Form2.Grid1.SelStartRow = CurItem
  447.          Form2.Grid1.SelEndRow = CurItem
  448.          Form2.Grid1.Col = 0
  449.          BEdit1.Text = Form2.Grid1.Text
  450.          Form2.Grid1.Col = 1
  451.          BEdit2.Text = Form2.Grid1.Text
  452.          Form2.Grid1.Col = 2
  453.          BEdit3.Text = Form2.Grid1.Text
  454.          Form2.Grid1.Col = 3
  455.          BEdit4.Text = Form2.Grid1.Text
  456.          Form2.Grid1.Col = 4
  457.          BEdit5.Text = Form2.Grid1.Text
  458.          Combo1.Text = ""
  459.          Picture1.Picture = LoadPicture("")
  460.       
  461.       Case 1
  462.          Form2.Grid1.Row = CurItem      ' Save current entry
  463.          Form2.Grid1.Col = 0
  464.          Form2.Grid1.Text = BEdit1.Text
  465.          Form2.Grid1.Col = 1
  466.          Form2.Grid1.Text = BEdit2.Text
  467.          Form2.Grid1.Col = 2
  468.          Form2.Grid1.Text = BEdit3.Text
  469.          Form2.Grid1.Col = 3
  470.          Form2.Grid1.Text = BEdit4.Text
  471.          Form2.Grid1.Col = 4
  472.          Form2.Grid1.Text = BEdit5.Text
  473.          
  474.          CompressItems
  475.          If CurItem > 1 Then
  476.             CurItem = CurItem - 1
  477.             Form3.Caption = "Item" + Str$(CurItem)
  478.          Else
  479.             MsgBox "At top of List"
  480.          End If
  481.          Form2.Grid1.Row = CurItem
  482.          Form2.Grid1.SelStartCol = 0
  483.          Form2.Grid1.SelEndCol = 5
  484.          Form2.Grid1.SelStartRow = CurItem
  485.          Form2.Grid1.SelEndRow = CurItem
  486.          Form2.Grid1.Col = 0
  487.          BEdit1.Text = Form2.Grid1.Text
  488.          Form2.Grid1.Col = 1
  489.          BEdit2.Text = Form2.Grid1.Text
  490.          Form2.Grid1.Col = 2
  491.          BEdit3.Text = Form2.Grid1.Text
  492.          Form2.Grid1.Col = 3
  493.          BEdit4.Text = Form2.Grid1.Text
  494.          Form2.Grid1.Col = 4
  495.          BEdit5.Text = Form2.Grid1.Text
  496.          Combo1.Text = ""
  497.          Picture1.Picture = LoadPicture("")
  498.       Case 2
  499.          Combo1.Text = ""
  500.          Picture1.Picture = LoadPicture()
  501.          BEdit1.Text = ""
  502.          BEdit2.Text = ""
  503.          BEdit3.Text = ""
  504.          BEdit4.Text = ""
  505.          BEdit5.Text = ""
  506.       Case 3
  507.          Form2.Grid1.Col = 0
  508.          Form2.Grid1.Text = BEdit1.Text
  509.          Form2.Grid1.Col = 1
  510.          Form2.Grid1.Text = BEdit2.Text
  511.          Form2.Grid1.Col = 2
  512.          Form2.Grid1.Text = BEdit3.Text
  513.          Form2.Grid1.Col = 3
  514.          Form2.Grid1.Text = BEdit4.Text
  515.          Form2.Grid1.Col = 4
  516.          Form2.Grid1.Text = BEdit5.Text
  517.          CalcTotals
  518.          Unload Form3
  519.    End Select
  520. End Sub
  521. Sub Form_Load ()
  522.    Form3.Top = (Screen.Height - Form3.Height) / 2
  523.    Form3.Left = (Screen.Width - Form3.Width) / 2
  524.    Combo1.AddItem "1  Candy Bar"
  525.    Combo1.AddItem "2  Cheeseburger"
  526.    Combo1.AddItem "3  Chips"
  527.    Combo1.AddItem "4  French Fries (small)"
  528.    Combo1.AddItem "5  French Fries (large)"
  529.    Combo1.AddItem "6  Hamburger"
  530.    Combo1.AddItem "7  Visual Basic 1.0"
  531.    Combo1.AddItem "8  Windows 3.1"
  532.    Combo1.AddItem "9  Pizza"
  533.    Combo1.AddItem "10 Soda Pop (small)"
  534.    Combo1.AddItem "11 Soda Pop (large)"
  535.    Combo1.AddItem "12 6' Sub Sandwich"
  536.    If Form2.Grid1.Row > NumItems Then
  537.       NumItems = NumItems + 1         ' Entering new item
  538.       Form2.Grid1.Row = NumItems
  539.    End If
  540.    CurItem = Form2.Grid1.Row
  541.    Form2.Grid1.Row = CurItem
  542.    Form2.Grid1.SelStartCol = 0
  543.    Form2.Grid1.SelEndCol = 5
  544.    Form2.Grid1.SelStartRow = CurItem
  545.    Form2.Grid1.SelEndRow = CurItem
  546.    Form2.Grid1.Col = 0
  547.    BEdit1.Text = LTrim$(Form2.Grid1.Text)
  548.    Form2.Grid1.Col = 1
  549.    BEdit2.Text = LTrim$(Form2.Grid1.Text)
  550.    Form2.Grid1.Col = 2
  551.    BEdit3.Text = LTrim$(Form2.Grid1.Text)
  552.    Form2.Grid1.Col = 3
  553.    BEdit4.Text = LTrim$(Form2.Grid1.Text)
  554.    Form2.Grid1.Col = 4
  555.    BEdit5.Text = Format$(Val(Form2.Grid1.Text), "##0.00")
  556. End Sub
  557.